package org.example.mapper;

import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import org.example.entity.SysDept;
import org.example.pojo.TableColumnDto;
import org.example.pojo.TableConfigDto;

import java.util.List;
import java.util.Map;

/**
 * @author wxm
 * @date 2025/2/13 15:17
 */
public interface TableColumnMapper extends BaseMapper<TableColumnDto> {
    List<String> selectAllTableName(@Param("tableModule") String tableModule);

    List<TableColumnDto> selectTableColumns(@Param("tableName") String tableName);

    void saveConfig(@Param("tableConfig") TableConfigDto tableConfig);

    List<TableColumnDto> selectTableComments(@Param("tableName") String tableName);

    List<Map<String, Object>> selectDataByTableName(@Param("tableName") String tableName);

    List<Map<String, Object>> selectDataByCondition(@Param("tableName") String tableName, @Param("rows") String rows, @Param("isSort") Boolean isSort, @Param("sortColumn") String sortColumn);

    List<Map<String, Object>> relevanceSelect(@Param("build") String build, @Param("column") String column, @Param("list") JSONArray list, @Param("tableName") String tableName);

    List<Map<String, Object>> selectAllData();

    List<SysDept> selectPageVo(IPage<SysDept> page);
}
